package com.company;

import java.util.Scanner;

public class Main {

    public String isWin;
    public static void main(String[] args) {
        Main main = new Main();
        System.out.println("开始游戏请按1，并输入0-9不同的随机数");
        NGuessNumber nGuessNumber = new NGuessNumber();
        Scanner input = new Scanner(System.in);
        int nextInt = input.nextInt();
        while (nextInt == 1) {
            main.isWin = String.valueOf(nGuessNumber.compareGuessAnswer());
            if (main.isWin.equals("true")){
                System.out.println("恭喜您获得成功！");
            }else if(main.isWin.equals("false")){
                System.out.println("很遗憾您失败了！");
            }
            System.out.println("输入2结束游戏");
            int nextInt1 = input.nextInt();
            if (nextInt1 == 2) {
                break;
            }
        }
    }
}
